using System;
using DevExpress.XtraEditors;
using DevTools.EventStuffGenerator.Components;

namespace DevTools.EventStuffGenerator.Controls
{
    public partial class InputControl : XtraUserControl
    {
        public InputControl()
        {
            InitializeComponent();

            bdsHistory.DataSource = HistoryManager.Instance;
        }

        public string EventName
        {
            get { return txtEventName.Text; }
        }

        public string Argument
        {
            get { return txtArgument.Text; }
        }

        private void lueHistory_EditValueChanged(object sender, System.EventArgs e)
        {
            HistoryItem historyItemItem = (HistoryItem) lueHistory.EditValue;

            txtEventName.Text = historyItemItem.EventName;
            txtArgument.Text = historyItemItem.Argument;
        }
    }
}